home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Graphics⁄Sound / RTrace-1.0-src / pp.h < prev    next >
Text File  |  1992-08-17  |  3KB  |  109 lines

  1. /*
  2.  * Copyright (c) 1988, 1992 Antonio Costa, INESC-Norte.
  3.  * All rights reserved.
  4.  *
  5.  * This code received contributions from the following people:
  6.  *
  7.  *  Roman Kuchkuda      - basic ray tracer
  8.  *  Mark VandeWettering - MTV ray tracer
  9.  *  Augusto Sousa       - overall, shading model
  10.  *  Paulo Almeida       - TEXT3D primitive
  11.  *  Pedro Borges        - TEXT3D primitive
  12.  *
  13.  * Redistribution and use in source and binary forms are permitted
  14.  * provided that the above copyright notice and this paragraph are
  15.  * duplicated in all such forms and that any documentation,
  16.  * advertising materials, and other materials related to such
  17.  * distribution and use acknowledge that the software was developed
  18.  * by Antonio Costa, at INESC-Norte. The name of the author and
  19.  * INESC-Norte may not be used to endorse or promote products derived
  20.  * from this software without specific prior written permission.
  21.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  22.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  23.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  24.  */
  25.  
  26. /**********************************************************************
  27.  *    RAY TRACING - Version 7.2                                       *
  28.  *                                                                    *
  29.  *    MADE BY    : Antonio Costa, INESC-Norte, June 1992              *
  30.  *    MODIFIED BY: Antonio Costa, INESC-Norte, June 1992              *
  31.  **********************************************************************/
  32.  
  33. /* Modified from defs.h /*
  34. /***** Types *****/
  35. typedef
  36. int             boolean;
  37.  
  38. typedef
  39. double          real;
  40.  
  41. typedef
  42. char           *char_ptr;
  43.  
  44. typedef
  45. FILE           *file_ptr;
  46.  
  47. /***** If there is no void type, define NOVOID *****/
  48. #ifdef NOVOID
  49. #define void char
  50. #define void_ptr char_ptr
  51. #else
  52. typedef
  53. void           *void_ptr;
  54. #endif
  55.  
  56. /***** Ray Tracing types *****/
  57. typedef
  58. struct
  59. {
  60.   real            x, y, z;
  61. } xyz_struct;
  62. typedef
  63. xyz_struct     *xyz_ptr;
  64.  
  65. typedef
  66. struct
  67. {
  68.   real            x, y, z, w;
  69. } xyzw_struct;
  70. typedef
  71. xyzw_struct    *xyzw_ptr;
  72.  
  73. typedef
  74. struct
  75. {
  76.   short int       type;
  77.   xyzw_ptr        transf;
  78.   void_ptr        next;
  79.   void_ptr        data;
  80. } texture_struct;
  81. typedef
  82. texture_struct *texture_ptr;
  83.  
  84. typedef
  85. struct
  86. {
  87.   xyz_ptr         position;
  88.   void_ptr        data;
  89. } text_struct;
  90. typedef
  91. text_struct    *text_ptr;
  92.  
  93. typedef
  94. struct
  95. {
  96.   int             id;           /* Object identifier  */
  97.   short int       surface_id;   /* Surface identifier */
  98.   real            refraction;   /* Refraction index   */
  99.   xyz_ptr         min, max;     /* Bounding volume    */
  100.   xyzw_ptr        transf;       /* Transformation     */
  101.   xyzw_ptr        inv_transf;   /* Inverse transf.    */
  102.   texture_ptr     texture;      /* List of textures   */
  103.   boolean         texture_modify_normal;
  104.   short int       object_type;
  105.   void_ptr        data;
  106. } object_struct;
  107. typedef
  108. object_struct  *object_ptr;
  109.